SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for t_authority
-- ----------------------------
DROP TABLE IF EXISTS `t_authority`;
CREATE TABLE `t_authority` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `orderby`  int(11) NULL DEFAULT NULL COMMENT '顺序' ,
  `url`  varchar(300)  NULL COMMENT '跳转链接' ,
  `parent_id`  int(11) NULL DEFAULT NULL COMMENT '父节点id' ,
  `name`  varchar(30)  NULL COMMENT '权限名' ,
  `status`  tinyint(4) NULL DEFAULT NULL COMMENT '状态' ,
  `short_name`  varchar(30)  NULL COMMENT '拼音简称' ,
  `has_child`  tinyint(4) NULL DEFAULT NULL ,
  PRIMARY KEY (`id`)
)
COMMENT='权限表'
AUTO_INCREMENT=27
;


-- ----------------------------
-- Table structure for t_authority_role
-- ----------------------------
DROP TABLE IF EXISTS `t_authority_role`;
CREATE TABLE `t_authority_role` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `role_id`  int(11) NULL DEFAULT NULL COMMENT '角色id' ,
  `authority_id`  int(11) NULL DEFAULT NULL COMMENT '权限树id' ,
  PRIMARY KEY (`id`)
)
COMMENT='权限与角色对应表'
AUTO_INCREMENT=304

;

-- ----------------------------
-- Table structure for t_department
-- ----------------------------
DROP TABLE IF EXISTS `t_department`;
CREATE TABLE `t_department` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `name`  varchar(50)  NULL COMMENT '部门名' ,
  `parent_id`  int(11) NULL DEFAULT NULL COMMENT '父节点id' ,
  `oa_id`  varchar(50)  NULL COMMENT 'oa系统部门id' ,
  PRIMARY KEY (`id`)
)
COMMENT='部门信息表'
AUTO_INCREMENT=9

;

-- ----------------------------
-- Records of t_department
-- ----------------------------
BEGIN;
INSERT INTO `t_department` VALUES ('4', '机构销售部', null, null);
COMMIT;

-- ----------------------------
-- Table structure for t_dictionary
-- ----------------------------
DROP TABLE IF EXISTS `t_dictionary`;
CREATE TABLE `t_dictionary` (
  `dic_value`  int(11) NOT NULL AUTO_INCREMENT ,
  `dic_code`  varchar(50)  NULL COMMENT '字典编码' ,
  `dic_name`  varchar(30)  NULL COMMENT '字典名称' ,
  `dic_item_name`  varchar(30)  NULL COMMENT '字典项' ,
  `dic_item_code`  varchar(30)  NULL ,
  `parent_id`  int(11) NULL DEFAULT NULL COMMENT '父字典id' ,
  PRIMARY KEY (`dic_value`)
)
COMMENT='数据字典'
AUTO_INCREMENT=71

;
-- ----------------------------
-- Table structure for t_organization
-- ----------------------------
DROP TABLE IF EXISTS `t_organization`;
CREATE TABLE `t_organization` (
  `org_id`  int(11) NOT NULL AUTO_INCREMENT COMMENT '机构编号' ,
  `org_name`  varchar(100)  NULL COMMENT '机构名称' ,
  `import_date`  datetime NULL DEFAULT NULL COMMENT '导入日期' ,
  `import_user_id`  int(11) NULL DEFAULT NULL COMMENT '导入用户' ,
  `status`  tinyint(4) NULL DEFAULT NULL COMMENT '状态码，0为被删除 1为未删除' ,
  PRIMARY KEY (`org_id`)
)
COMMENT='机构表'
AUTO_INCREMENT=404

;

-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `name`  varchar(30)  NULL COMMENT '角色名' ,
  `create_date`  datetime NULL DEFAULT NULL COMMENT '创建时间' ,
  `status`  tinyint(4) NULL DEFAULT NULL COMMENT '状态' ,
  `parent_id`  int(11) NULL DEFAULT NULL ,
  `describe`  varchar(255)  NULL ,
  PRIMARY KEY (`id`)
)
COMMENT='角色表'
AUTO_INCREMENT=19

;

-- ----------------------------
-- Records of t_role
-- ----------------------------
BEGIN;
INSERT INTO `t_role` VALUES ('1', '管理员', '2017-08-04 13:22:31', '1', '1', '这是管理员');
COMMIT;

-- ----------------------------
-- Table structure for t_role_user
-- ----------------------------
DROP TABLE IF EXISTS `t_role_user`;
CREATE TABLE `t_role_user` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `user_id`  int(11) NULL DEFAULT NULL ,
  `role_id`  int(11) NULL DEFAULT NULL ,
  PRIMARY KEY (`id`)
)
COMMENT='用户与角色对应表'
AUTO_INCREMENT=320

;

-- ----------------------------
-- Table structure for t_sm_record
-- ----------------------------
DROP TABLE IF EXISTS `t_sm_record`;
CREATE TABLE `t_sm_record` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `dest_mobile`  varchar(30)  NULL COMMENT '目标手机号' ,
  `sm_content`  varchar(200)  NULL COMMENT '短信内容' ,
  `send_channel`  varchar(50)  NULL COMMENT '发送渠道' ,
  `send_time`  datetime NULL DEFAULT NULL COMMENT '发送时间' ,
  `resend_time`  datetime NULL DEFAULT NULL COMMENT '重发时间' ,
  `send_status`  tinyint(4) NULL DEFAULT NULL COMMENT '发送状态' ,
  `send_num`  int(11) NULL DEFAULT NULL COMMENT '发送号码' ,
  PRIMARY KEY (`id`)
)
  AUTO_INCREMENT=1

;

-- ----------------------------
-- Records of t_sm_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_team
-- ----------------------------
DROP TABLE IF EXISTS `t_team`;
CREATE TABLE `t_team` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `name`  varchar(30)  NULL COMMENT '团队名' ,
  `leader_id`  int(11) NULL DEFAULT NULL COMMENT '团队负责人' ,
  `create_date`  datetime NULL DEFAULT NULL COMMENT '创建时间' ,
  `status`  tinyint(4) NULL DEFAULT NULL COMMENT '团队状态' ,
  PRIMARY KEY (`id`)
)
COMMENT='团队信息表'
AUTO_INCREMENT=13

;

-- ----------------------------
-- Records of t_team
-- ----------------------------
BEGIN;
INSERT INTO `t_team` VALUES ('8', '1陈浩组', '0', '2018-07-10 17:11:41', '40'), ('9', '3陈杰辉组', '0', '2018-07-10 17:11:49', '40'), ('10', '5杨光玉组', '0', '2018-07-10 17:11:58', '40'), ('11', '6肖玲组', '0', '2018-07-10 17:12:39', '40'), ('12', '交易组', '0', '2018-07-10 17:12:47', '40');
COMMIT;

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `account`  varchar(20)  NULL COMMENT '登录账户' ,
  `name`  varchar(50)  NULL ,
  `password`  varchar(200)  NULL COMMENT '登录密码' ,
  `mobile`  varchar(20)  NULL COMMENT '移动电话' ,
  `email`  varchar(60)  NULL COMMENT '电子邮箱' ,
  `status`  tinyint(4) NULL DEFAULT NULL COMMENT '用户状态' ,
  `register_date`  datetime NULL DEFAULT NULL COMMENT '注册日期' ,
  `recent_login_date`  datetime NULL DEFAULT NULL COMMENT '最近登录日期' ,
  `phone`  varchar(20)  NULL COMMENT '工作电话' ,
  `number`  varchar(30)  NULL COMMENT '工号' ,
  `department`  tinyint(4) NULL DEFAULT NULL COMMENT '所属部门' ,
  PRIMARY KEY (`id`)
)
COMMENT='用户表'
AUTO_INCREMENT=79

;

-- ----------------------------
-- Records of t_user
-- ----------------------------
BEGIN;
INSERT INTO `t_user` VALUES ('1', 'admin', '管理员', '240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9', '1850000000', 'admin@grzq.com', '4', '2017-08-03 13:30:51', '2017-08-03 13:30:56', '83990000', '2104', '5');
COMMIT;

DROP TABLE IF EXISTS `t_team_user`;
CREATE TABLE `t_team_user` (
  `id`  int(11) NOT NULL AUTO_INCREMENT ,
  `user_id`  varchar(30)  NULL COMMENT '用户id' ,
  `team_id`  int(11) NULL DEFAULT NULL COMMENT '团队id' ,
  `create_date`  datetime NULL DEFAULT NULL COMMENT '创建时间' ,
  `status`  tinyint(4) NULL DEFAULT NULL COMMENT '状态' ,
  PRIMARY KEY (`id`)
)
COMMENT='用户团队关系表'
AUTO_INCREMENT=1
;